<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!-- 屏蔽tomcat 自带的 EL表达式 -->
<%@ page isELIgnored="false" %>  
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <script type="text/javascript" src="${ctx}/static/js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="${ctx}/static/layer/layer.js"></script>
    <script type="text/javascript" src="${ctx}/static/js/ajax.js"></script>
    <script type="text/javascript" src="${ctx}/static/js/form.js"></script>
    <script type="text/javascript" src="${ctx}/static/bootstrap/bootstrap.js"></script>
    <script type="text/javascript" src="${ctx}/static/bootstrap/bootstrap-select.js"></script>
    <script type="text/javascript" src="${ctx}/static/bootstrap/bootstrap-select-zh_CN.js"></script>
    <script type="text/javascript" src="${ctx}/static/nice-validator/jquery.validator.js?local=zh-CN"></script>
    <link rel="stylesheet" type="text/css" href="${ctx}/static/bootstrap/bootstrap.css" media="all">
    <link rel="stylesheet" type="text/css" href="${ctx}/static/bootstrap/bootstrap-select.css" media="all">
    <link rel="stylesheet" type="text/css" href="${ctx}/static/larry/css/fonts/font-awesome.min.css" media="all">
    <title>用户信息</title>
    <script type="text/javascript">
    	 var ctx = "${ctx}";
    	 function initInfo(data){
    		 $('#roleform').initForm(data); 
    	 }
    	 ;$(document).ready(function(){
    		 $('#roleform').on('valid.form', function(e, form){
    	 		    $.mask.post(ctx + '/role/roleInfo/save', $("#roleform").serializeArray(), function(data) {
    	 				if (data.success) {
    	 					$.mask.alert(data.msg,function(){
    	 						parent.layer.closeAll();//关闭编辑页面
    	 						parent.roleTable.bootstrapTable('refreshOptions', {pageNumber : 1});//调用刷新父页面
    	 					});
    	 				} else {
    	 					$.mask.alert(data.msg);
    	 				}
    	 			});
    	 	  	}); 
    	 });
    	 
    </script>
</head>
<body style="padding-top: 8px;">
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span12">
						
					<form role="form" id="roleform" class="form-horizontal " data-validator-option="{theme:'yellow_right', timely:3, stopOnError:false,focusCleanup:true,invalidClass: 'has-error'}">
						  <div class="form-group">
							    <label for="roleName" class="col-sm-3 control-label">角色名称</label>
							    <div class="col-sm-9"><input type="text" class="form-control" id="roleName" name="roleName" data-rule="required"  autocomplete="off"></div>
							  
						  </div>
						   <div class="form-group">
							   
							    <label for="roleDesc" class="col-sm-3 control-label">角色描述</label>
							    <div class="col-sm-9"><input type="text" class="form-control" id="nameCode" name="roleDesc"  data-rule="required"  autocomplete="off"></div>
						  </div>
						  
						 <div class="form-group">
							<div class="col-sm-offset-5 col-sm-3">
								<button id="btnsubmit" type="submit" class="btn  btn-green"><i class="fa fa-floppy-o" aria-hidden="true"></i> 保存</button>
							</div>
						</div>
						<input type="hidden" name ="version">
						<input type="hidden" name ="roleCode">
				 </form>
			</div>
		</div>
	</div>
</body>
</html>
